/*
 * 
 */
package org.giovanolli.mumi.controller.payment;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import org.giovanolli.mumi.controller.AbstractModel;
import org.giovanolli.mumi.entities.Bill;
import org.giovanolli.mumi.entities.BillDetail;
import org.giovanolli.mumi.entities.Patient;
import org.giovanolli.mumi.entities.PatientPrepaid;
import org.giovanolli.mumi.entities.PaymentType;
import org.giovanolli.mumi.entities.Specialist;
import org.giovanolli.mumi.entities.SpecialistFee;
import org.giovanolli.mumi.entities.Speciality;
import org.giovanolli.mumi.view.datamodel.DefaultSelectionDataModelListener;
import org.giovanolli.mumi.view.datamodel.SelectableDataModel;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Controller;

// TODO: Auto-generated Javadoc
/**
 * The Class BillModel.
 */
@Controller("billModel")
@Scope(value = "flow", proxyMode = ScopedProxyMode.TARGET_CLASS)
public class BillModel extends AbstractModel<Bill> implements Cloneable {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -5216283281192374597L;

	/** The sort property. */
	private String sortProperty;

	/** The patient. */
	private Patient patient;

	/** The selectable patients. */
	private List<Patient> selectablePatients;

	/** The payment type. */
	private PaymentType paymentType;

	/** The date. */
	private Date date;

	/** The amount. */
	private Double amount;

	/** The patient prepaid. */
	private PatientPrepaid patientPrepaid;

	/** The selectable patient prepaids. */
	private List<PatientPrepaid> selectablePatientPrepaids;

	/** The roles data model. */
	private BillDetailSelectionDataModel selectableBillDetails;

	/** The bill details. */
	private List<BillDetail> billDetails;

	/** The bill details data model. */
	private SelectableDataModel<BillDetail> billDetailsDataModel;

	/** The bill details selection listener. */
	private DefaultSelectionDataModelListener<BillDetail> billDetailsSelectionListener;

	/** The edited bill detail. */
	private BillDetail editedBillDetail;

	/** The speciality. */
	private Speciality speciality;

	/** The selectable specialities. */
	private List<Speciality> selectableSpecialities;

	/** The specialist. */
	private Specialist specialist;

	/** The selectable specialists. */
	private List<Specialist> selectableSpecialists;

	/** The specialist fee. */
	private SpecialistFee specialistFee;

	/**
	 * Instantiates a new bill model.
	 */
	public BillModel() {
		billDetails = new ArrayList<BillDetail>();
		return;
	}

	/**
	 * Gets the amount.
	 * 
	 * @return the amount
	 */
	public Double getAmount() {
		return amount;
	}

	/**
	 * Gets the bill details.
	 * 
	 * @return the bill details
	 */
	public List<BillDetail> getBillDetails() {
		return billDetails;
	}

	/**
	 * Gets the bill details data model.
	 * 
	 * @return the bill details data model
	 */
	public SelectableDataModel<BillDetail> getBillDetailsDataModel() {
		return billDetailsDataModel;
	}

	/**
	 * Gets the bill details selection listener.
	 * 
	 * @return the bill details selection listener
	 */
	public DefaultSelectionDataModelListener<BillDetail> getBillDetailsSelectionListener() {
		return billDetailsSelectionListener;
	}

	/**
	 * Gets the date.
	 * 
	 * @return the date
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * Gets the edited bill detail.
	 * 
	 * @return the edited bill detail
	 */
	public BillDetail getEditedBillDetail() {
		return editedBillDetail;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.giovanolli.mumi.controller.AbstractModel#getPageNumber()
	 */
	public Integer getPageNumber() {
		return pageNumber;
	}

	/**
	 * Gets the patient.
	 * 
	 * @return the patient
	 */
	public Patient getPatient() {
		return patient;
	}

	/**
	 * Gets the patient prepaid.
	 * 
	 * @return the patient prepaid
	 */
	public PatientPrepaid getPatientPrepaid() {
		return patientPrepaid;
	}

	/**
	 * Gets the payment type.
	 * 
	 * @return the payment type
	 */
	public PaymentType getPaymentType() {
		return paymentType;
	}

	/**
	 * Gets the selectable bill details.
	 * 
	 * @return the selectable bill details
	 */
	public BillDetailSelectionDataModel getSelectableBillDetails() {
		return selectableBillDetails;
	}

	/**
	 * Gets the selectable patient prepaids.
	 * 
	 * @return the selectable patient prepaids
	 */
	public List<PatientPrepaid> getSelectablePatientPrepaids() {
		return selectablePatientPrepaids;
	}

	/**
	 * Gets the selectable patients.
	 * 
	 * @return the selectable patients
	 */
	public List<Patient> getSelectablePatients() {
		return selectablePatients;
	}

	/**
	 * Gets the selectable payment types.
	 * 
	 * @return the selectable payment types
	 */
	public List<PaymentType> getSelectablePaymentTypes() {
		return Arrays.asList(PaymentType.values());
	}

	/**
	 * Gets the selectable specialists.
	 * 
	 * @return the selectable specialists
	 */
	public List<Specialist> getSelectableSpecialists() {
		return selectableSpecialists;
	}

	/**
	 * Gets the selectable specialities.
	 * 
	 * @return the selectable specialities
	 */
	public List<Speciality> getSelectableSpecialities() {
		return selectableSpecialities;
	}

	/**
	 * Gets the sort property.
	 * 
	 * @return the sort property
	 */
	public String getSortProperty() {
		return sortProperty;
	}

	/**
	 * Gets the specialist.
	 * 
	 * @return the specialist
	 */
	public Specialist getSpecialist() {
		return specialist;
	}

	/**
	 * Gets the specialist fee.
	 * 
	 * @return the specialist fee
	 */
	public SpecialistFee getSpecialistFee() {
		return specialistFee;
	}

	/**
	 * Gets the speciality.
	 * 
	 * @return the speciality
	 */
	public Speciality getSpeciality() {
		return speciality;
	}

	/**
	 * Sets the amount.
	 * 
	 * @param amount
	 *            the new amount
	 */
	public void setAmount(Double amount) {
		this.amount = amount;
	}

	/**
	 * Sets the bill details.
	 * 
	 * @param billDetails
	 *            the new bill details
	 */
	public void setBillDetails(List<BillDetail> billDetails) {
		this.billDetails = billDetails;
	}

	/**
	 * Sets the bill details data model.
	 * 
	 * @param billDetailsDataModel
	 *            the new bill details data model
	 */
	public void setBillDetailsDataModel(SelectableDataModel<BillDetail> billDetailsDataModel) {
		this.billDetailsDataModel = billDetailsDataModel;
	}

	/**
	 * Sets the bill details selection listener.
	 * 
	 * @param billDetailsSelectionListener
	 *            the new bill details selection listener
	 */
	public void setBillDetailsSelectionListener(DefaultSelectionDataModelListener<BillDetail> billDetailsSelectionListener) {
		this.billDetailsSelectionListener = billDetailsSelectionListener;
	}

	/**
	 * Sets the date.
	 * 
	 * @param date
	 *            the new date
	 */
	public void setDate(Date date) {
		this.date = date;
	}

	/**
	 * Sets the edited bill detail.
	 * 
	 * @param editedBillDetail
	 *            the new edited bill detail
	 */
	public void setEditedBillDetail(BillDetail editedBillDetail) {
		this.editedBillDetail = editedBillDetail;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.giovanolli.mumi.controller.AbstractModel#setPageNumber(java.lang. Integer)
	 */
	public void setPageNumber(Integer pageNumber) {
		this.pageNumber = pageNumber;
	}

	/**
	 * Sets the patient.
	 * 
	 * @param patient
	 *            the new patient
	 */
	public void setPatient(Patient patient) {
		this.patient = patient;
	}

	/**
	 * Sets the patient prepaid.
	 * 
	 * @param patientPrepaid
	 *            the new patient prepaid
	 */
	public void setPatientPrepaid(PatientPrepaid patientPrepaid) {
		this.patientPrepaid = patientPrepaid;
	}

	/**
	 * Sets the payment type.
	 * 
	 * @param paymentType
	 *            the new payment type
	 */
	public void setPaymentType(PaymentType paymentType) {
		this.paymentType = paymentType;
	}

	/**
	 * Sets the selectable bill details.
	 * 
	 * @param selectableBillDetails
	 *            the new selectable bill details
	 */
	public void setSelectableBillDetails(BillDetailSelectionDataModel selectableBillDetails) {
		this.selectableBillDetails = selectableBillDetails;
	}

	/**
	 * Sets the selectable patient prepaids.
	 * 
	 * @param selectablePatientPrepaids
	 *            the new selectable patient prepaids
	 */
	public void setSelectablePatientPrepaids(List<PatientPrepaid> selectablePatientPrepaids) {
		this.selectablePatientPrepaids = selectablePatientPrepaids;
	}

	/**
	 * Sets the selectable patients.
	 * 
	 * @param selectablePatients
	 *            the new selectable patients
	 */
	public void setSelectablePatients(List<Patient> selectablePatients) {
		this.selectablePatients = selectablePatients;
	}

	/**
	 * Sets the selectable specialists.
	 * 
	 * @param selectableSpecialists
	 *            the new selectable specialists
	 */
	public void setSelectableSpecialists(List<Specialist> selectableSpecialists) {
		this.selectableSpecialists = selectableSpecialists;
	}

	/**
	 * Sets the selectable specialities.
	 * 
	 * @param selectableSpecialities
	 *            the new selectable specialities
	 */
	public void setSelectableSpecialities(List<Speciality> selectableSpecialities) {
		this.selectableSpecialities = selectableSpecialities;
	}

	/**
	 * Sets the sort property.
	 * 
	 * @param sortProperty
	 *            the new sort property
	 */
	public void setSortProperty(String sortProperty) {
		this.sortProperty = sortProperty;
	}

	/**
	 * Sets the specialist.
	 * 
	 * @param specialist
	 *            the new specialist
	 */
	public void setSpecialist(Specialist specialist) {
		this.specialist = specialist;
	}

	/**
	 * Sets the specialist fee.
	 * 
	 * @param specialistFee
	 *            the new specialist fee
	 */
	public void setSpecialistFee(SpecialistFee specialistFee) {
		this.specialistFee = specialistFee;
	}

	/**
	 * Sets the speciality.
	 * 
	 * @param speciality
	 *            the new speciality
	 */
	public void setSpeciality(Speciality speciality) {
		this.speciality = speciality;
	}

}
